/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.jfonia.connect5.numerical;

import org.jfonia.connect5.basics.MutableValueNode;
import org.jfonia.connect5.basics.ValueNode;
import org.jfonia.connect5.relations.ABCRelation;

/**
 *
 * @author installer
 */
public class LongSumRelation extends ABCRelation<Long, Long, Long>
{
	public LongSumRelation(ValueNode<Long> a, MutableValueNode<Long> b, MutableValueNode<Long> c)
	{
		super(a, b, c);
	}

	public void updateB()
	{
		b.setValue(c.getValue() - a.getValue(), this);
	}

	public void updateC()
	{
		c.setValue(a.getValue() + b.getValue(), this);
	}



}